package in.ac.dei.edrp.cms.controller.reportgeneration;


import in.ac.dei.edrp.cms.dao.reportgeneration.ProgressCardDao;
import in.ac.dei.edrp.cms.domain.reportgeneration.ProgressCardInfo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

public class ProgressCard extends AbstractController{

	private ProgressCardDao progressCardDao;		
	
	public void setProgressCardDao(ProgressCardDao progressCardDao) {
		this.progressCardDao = progressCardDao;
	}


	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception { 		
		String entityId = request.getParameter("entityId");
		String programId = request.getParameter("programId");
		String progressCardType = request.getParameter("reportType");		
		String semesterId = request.getParameter("semesterId");		
		String semesterStartDate = request.getParameter("semesterStartDate");
		String semesterEndDate = request.getParameter("semesterEndDate");
		String semesterSequence = request.getParameter("semesterSequence"); 
		String report = request.getParameter("report");	
		System.out.println("report "+report);
		System.out.println(entityId + " "+programId +" "+semesterEndDate+" "+semesterStartDate + " "+semesterId +" "+semesterSequence);
		String universityCode = "0001";
		ProgressCardInfo progressCardInfo = new ProgressCardInfo();
		progressCardInfo.setEntityId(entityId);
		progressCardInfo.setProgramId(programId);
		progressCardInfo.setSemesterEndDate(semesterEndDate);
		progressCardInfo.setSemesterStartDate(semesterStartDate);
		progressCardInfo.setUniversityCode(universityCode);	
		progressCardInfo.setSemesterId(semesterId);
		progressCardInfo.setProgressCardType(progressCardType);
		progressCardInfo.setSemesterSequence(semesterSequence);
		progressCardInfo.setWhatToPrint(report);
	
	 return new ModelAndView("pdfViewConverter","progressCardData",progressCardInfo);		
	}	
}
